package com.learn.demo.lambda.core4api;

import java.util.function.Supplier;

/**
 * 供给型接口
 *
 * @author banjiawei
 * @date 2021/06/19
 */
public class SupplierDemo {
    public static void main(String[] args) {
        Supplier<Integer> supplier = () -> new Long(Math.round(Math.random() * 100)).intValue();
        for (int i = 0; i < 10; i++) {
            Integer randomNum = supplier.get();
            System.out.println(randomNum);
        }
    }
}
